package com.hqch.mina;

import org.apache.mina.core.filterchain.IoFilterAdapter;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.core.write.WriteRequest;

public class MinaLoggerFilter extends IoFilterAdapter {

	@Override
	public void messageReceived(NextFilter nextFilter, IoSession session,
			Object message) throws Exception {
		System.out.println(this.getClass().getName() + "===messageReceived");
		nextFilter.messageReceived(session, nextFilter);
	}

	@Override
	public void messageSent(NextFilter nextFilter, IoSession session,
			WriteRequest writeRequest) throws Exception {
		System.out.println(this.getClass().getName() + "===messageSent");
		nextFilter.messageSent(session, writeRequest);
	}

	@Override
	public void sessionClosed(NextFilter nextFilter, IoSession session)
			throws Exception {
		System.out.println(this.getClass().getName() + "===sessionClosed");
		nextFilter.sessionClosed(session);
	}

	@Override
	public void sessionCreated(NextFilter nextFilter, IoSession session)
			throws Exception {
		System.out.println(this.getClass().getName() + "===sessionCreated");
		nextFilter.sessionCreated(session);
	}

	@Override
	public void sessionOpened(NextFilter nextFilter, IoSession session)
			throws Exception {
		System.out.println(this.getClass().getName() + "===sessionOpened");
		nextFilter.sessionOpened(session);
	}

	
}
